home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qbsnip.zip / SPRIT_EX.BAS < prev    next >
BASIC Source File  |  1996-11-17  |  1KB  |  35 lines

  1. 'Sprite Example
  2. 'Author Unknown
  3.  
  4. DEFINT A-Z
  5. SCREEN 13
  6. PALETTE 255, 1024 * 15          'Change color 255 so it's visible
  7. DIM Image(0 TO 33), Scr(0 TO 33), OldBuff(0 TO 33)
  8.  
  9. InColr = 4                      'The inner color of the circle
  10. OutColr = 3                     'The color of its outer ring
  11. CIRCLE (5, 5), 4, OutColr       'Draw original Image -- make transparent
  12. PAINT (5, 5), InColr, OutColr   'areas Color 0
  13. GET (1, 2)-(9, 8), Image
  14.  
  15. LINE (16, 2)-(24, 8), 255, BF   'Draw its compliment -- Color 0
  16. CIRCLE (20, 5), 4, 0            'for solid areas, Color 255 (or 15 in EGA
  17. PAINT (20, 5), 0, 0             'modes) for transparent areas
  18. GET (16, 2)-(24, 8), Scr
  19.  
  20. CLS
  21. FOR Repeat = 1 TO 9             'Draw a background pattern
  22.   LINE (0, 20 * Repeat)-(320, 200), Repeat + 20, BF
  23. NEXT
  24.  
  25. FOR Repeat = 1 TO 300           'Draw the sprites
  26.   y = 96: x = x + 1
  27.   GET (x, y)-(x + 8, y + 6), OldBuff
  28.   PUT (x, y), Scr, AND
  29.   PUT (x, y), Image, OR
  30.   FOR delay% = 1 TO 4000: NEXT
  31.   PUT (x, y), OldBuff, PSET
  32. NEXT
  33. SCREEN 0: WIDTH 80: COLOR 7, 0: CLS : END
  34.  
  35.